<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      NetworkManager-1.22.10
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;16.&nbsp;Networking Utilities
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="bind-utils.html" title=
          "BIND Utilities-9.16.1">Prev</a>
          <p>
            BIND Utilities-9.16.1
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="nmap.html" title="Nmap-7.80">Next</a>
          <p>
            Nmap-7.80
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="netutils.html" title=
          "Chapter&nbsp;16.&nbsp;Networking Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="NetworkManager" name=
        "NetworkManager"></a>NetworkManager-1.22.10
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to NetworkManager
        </h2>
        <p>
          <span class="application">NetworkManager</span> is a set of
          co-operative tools that make networking simple and straightforward.
          Whether you use WiFi, wired, 3G, or Bluetooth, NetworkManager
          allows you to quickly move from one network to another: Once a
          network has been configured and joined once, it can be detected and
          re-joined automatically the next time it's available.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "http://ftp.gnome.org/pub/gnome/sources/NetworkManager/1.22/NetworkManager-1.22.10.tar.xz">
                http://ftp.gnome.org/pub/gnome/sources/NetworkManager/1.22/NetworkManager-1.22.10.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download (FTP): <a class="ulink" href=
                "ftp://ftp.gnome.org/pub/gnome/sources/NetworkManager/1.22/NetworkManager-1.22.10.tar.xz">
                ftp://ftp.gnome.org/pub/gnome/sources/NetworkManager/1.22/NetworkManager-1.22.10.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: b7b8875c3ef1db0989f78351ba3e8ad8
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 4.5 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 862 MB (with tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.8 SBU (with tests; both using
                parallelism=4)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          NetworkManager Dependencies
        </h3>
        <h4>
          Required
        </h4>
        <p class="required">
          <a class="xref" href="../general/dbus-glib.html" title=
          "dbus-glib-0.110">dbus-glib-0.110</a> and <a class="xref" href=
          "libndp.html" title="libndp-1.7">libndp-1.7</a>
        </p>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          <a class="xref" href="curl.html" title=
          "cURL-7.69.1">cURL-7.69.1</a>, <a class="xref" href="dhcpcd.html"
          title="dhcpcd-8.1.6">dhcpcd-8.1.6</a> or <a class="xref" href=
          "dhcp.html" title="DHCP-4.4.2">DHCP-4.4.2</a> (client only),
          <a class="xref" href="../general/gobject-introspection.html" title=
          "gobject-introspection-1.64.0">gobject-introspection-1.64.0</a>,
          <a class="xref" href="../postlfs/iptables.html" title=
          "iptables-1.8.4">iptables-1.8.4</a>, <a class="xref" href=
          "../general/jansson.html" title="Jansson-2.12">jansson-2.12</a>,
          <a class="xref" href="../general/newt.html" title=
          "newt-0.52.21">newt-0.52.21</a> (for <span class=
          "command"><strong>nmtui</strong></span>), <a class="xref" href=
          "../postlfs/nss.html" title="NSS-3.51">NSS-3.51</a>, <a class=
          "xref" href="../postlfs/polkit.html" title=
          "Polkit-0.116">Polkit-0.116</a>, <a class="xref" href=
          "../general/python-modules.html#pygobject3" title=
          "PyGObject-3.36.0">PyGObject-3.36.0</a>, <span class=
          "phrase"><a class="xref" href="../general/elogind.html" title=
          "elogind-243.7">elogind-243.7</a>,</span> <a class="xref" href=
          "../general/upower.html" title="UPower-0.99.11">UPower-0.99.11</a>,
          <a class="xref" href="../general/vala.html" title=
          "Vala-0.48.2">Vala-0.48.2</a>, and <a class="xref" href=
          "wpa_supplicant.html" title=
          "wpa_supplicant-2.9">wpa_supplicant-2.9</a> (built with D-Bus
          support),
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="../general/bluez.html" title=
          "BlueZ-5.54">BlueZ-5.54</a>, <a class="xref" href=
          "../general/python-modules.html#dbus-python" title=
          "D-Bus Python-1.2.16">D-Bus Python-1.2.16</a> (for the test suite),
          <a class="xref" href="../postlfs/gnutls.html" title=
          "GnuTLS-3.6.13">GnuTLS-3.6.13</a> (used if <a class="xref" href=
          "../postlfs/nss.html" title="NSS-3.51">NSS-3.51</a> is not found),
          <a class="xref" href="../general/gtk-doc.html" title=
          "GTK-Doc-1.32">GTK-Doc-1.32</a>, <a class="xref" href="libpsl.html"
          title="libpsl-0.21.0">libpsl-0.21.0</a>, <a class="xref" href=
          "../x/qt5.html" title="Qt-5.14.1">Qt-5.14.1</a> (for examples),
          <a class="xref" href="../general/ModemManager.html" title=
          "ModemManager-1.12.8">ModemManager-1.12.8</a>, <a class="xref"
          href="../general/valgrind.html" title=
          "Valgrind-3.15.0">Valgrind-3.15.0</a>, <a class="ulink" href=
          "http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a>,
          <a class="ulink" href=
          "https://github.com/Distrotech/libaudit">libaudit</a>, <a class=
          "ulink" href="https://github.com/jpirko/libteam">libteam</a>,
          <a class="ulink" href=
          "https://ftp.gnome.org/pub/gnome/sources/mobile-broadband-provider-info/">
          mobile-broadband-provider-info</a>, <a class="ulink" href=
          "https://www.samba.org/ftp/ppp/">PPP</a>, and <a class="ulink"
          href="https://dianne.skoll.ca/projects/rp-pppoe/">RP-PPPoE</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/NetworkManager">http://wiki.linuxfromscratch.org/blfs/wiki/NetworkManager</a>
        </p>
      </div>
      <div class="kernel" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="NetworkManager-kernel" name=
          "NetworkManager-kernel"></a>Kernel Configuration
        </h2>
        <p>
          If you wish to run the tests, enable the following options in the
          kernel configuration and recompile the kernel if necessary:
        </p>
        <pre class="screen">
<code class="literal">Device Drivers ---&gt;
  [*] Network device support         [CONFIG_NETDEVICES] ---&gt;
    [*] Bonding driver support       [CONFIG_BONDING]
    [*] Dummy net driver support     [CONFIG_DUMMY]
    [*] Ethernet team driver support [CONFIG_NET_TEAM]</code>
</pre>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of NetworkManager
        </h2>
        <p>
          If <a class="xref" href="../x/qt5.html" title=
          "Qt-5.14.1">Qt-5.14.1</a> is installed and the Qt based examples
          are desired, fix two meson.build files:
        </p>
        <pre class="userinput">
<kbd class="command">sed -e 's/-qt4/-qt5/'              \
    -e 's/moc_location/host_bins/' \
    -i examples/C/qt/meson.build   &amp;&amp;
sed -e 's/Qt/&amp;5/'                  \
    -i meson.build</kbd>
</pre>
        <p>
          Fix a missing meson.build file for initrd hooks (not used in BLFS):
        </p>
        <pre class="userinput">
<kbd class="command">sed '/initrd/d' -i src/meson.build</kbd>
</pre>
        <p>
          Fix the python scripts so that they use <span class=
          "application">Python 3</span>:
        </p>
        <pre class="userinput">
<kbd class=
"command">grep -rl '^#!.*python$' | xargs sed -i '1s/python/&amp;3/'</kbd>
</pre>
        <p>
          Install <span class="application">NetworkManager</span> by running
          the following commands:
        </p>
        <pre class="userinput">
<kbd class="command">mkdir build &amp;&amp;
cd    build &amp;&amp;

CXXFLAGS+="-O2 -fPIC"            \
meson --prefix /usr              \
      --sysconfdir /etc          \
      --localstatedir /var       \
      -Djson_validation=false    \
      -Dlibaudit=no              \
      -Dlibpsl=false             \
      -Dnmtui=true               \
      -Dovs=false                \
      -Dppp=false                \
      -Dselinux=false            \
      -Dudev_dir=/lib/udev       \
      -Dsession_tracking=elogind \
      -Dmodem_manager=false      \
      -Dsystemdsystemunitdir=no  \
      -Dsystemd_journal=false    \
      -Dqt=false                 \
      .. &amp;&amp;
ninja</kbd>
</pre>
        <p>
          An already active graphical session with a bus address is necessary
          to run the tests. To test the results, as the root user, issue:
          <span class="command"><strong>ninja test</strong></span>. One test,
          test-core, is known to fail.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">ninja install &amp;&amp;
mv -v /usr/share/doc/NetworkManager{,-1.22.10}</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <code class="envar">CXXFLAGS="-O2 -fPIC"</code>: These compiler
          options are necessary to build the Qt5 based examples.
        </p>
        <p>
          <code class="option">-Ddocs=true</code>: Use this switch to enable
          building man pages and documentation if <a class="xref" href=
          "../general/gtk-doc.html" title="GTK-Doc-1.32">GTK-Doc-1.32</a> is
          installed.
        </p>
        <p>
          <em class="parameter"><code>-Dnmtui=true</code></em>: This
          parameter enables building <span class=
          "command"><strong>nmtui</strong></span>.
        </p>
        <p>
          <em class="parameter"><code>-Dsystemdsystemunitdir=no</code></em>
          and <em class=
          "parameter"><code>-Dsystemd_journal=false</code></em>: systemd is
          not used for sysv init systems.
        </p>
        <p>
          <em class="parameter"><code>-Djson_validation=false</code></em>,
          <em class="parameter"><code>-Dlibpsl=false</code></em>, and
          <em class="parameter"><code>-Dovs=false</code></em>: These switches
          disable building with the respective libraries. Remove if you have
          the needed libraries installed.
        </p>
        <p>
          <em class="parameter"><code>-Dmodem_manager=false</code></em>: This
          switch is requried if <span class="application">ModemManager</span>
          is not installed. Omit if you have built <span class=
          "application">ModemManager</span> and <span class=
          "application">mobile-broadband-provider-info</span>.
        </p>
        <p>
          <em class="parameter"><code>-Dsession_tracking=elogind</code></em>:
          This switch is used to set <span class=
          "command"><strong>elogind</strong></span> as the default program
          for session tracking.
        </p>
        <p>
          <em class="parameter"><code>-Dppp=false</code></em>: This parameter
          disables <span class="application">PPP</span> support in
          <span class="application">NetworkManager</span>.
        </p>
        <p>
          <em class="parameter"><code>-Dlibaudit=no</code></em> and
          <em class="parameter"><code>-Dselinux=false</code></em>: libaudit
          and SELinux are not used in BLFS.
        </p>
        <p>
          <em class="parameter"><code>-Dqt=false</code></em>: disables the
          <span class="application">QT</span> examples. Omit if you have
          <span class="application">QT</span> available and wish to install
          the examples.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring NetworkManager
        </h2>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="NetworkManager-config" name="NetworkManager-config"></a>
          </h3>
          <h4 class="title">
            <a id="NetworkManager-config" name=
            "NetworkManager-config"></a>Config Files
          </h4>
          <p>
            <code class=
            "filename">/etc/NetworkManager/NetworkManager.conf</code>
          </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3"></h3>
          <h4 class="title">
            <a id="idm140006440387760" name=
            "idm140006440387760"></a>Configuration Information
          </h4>
          <p>
            For <span class="application">NetworkManager</span> to work, at
            least a minimal configuration file must be present. Such file is
            not installed with <span class="command"><strong>make
            install</strong></span>. Issue the following command as the
            <code class="systemitem">root</code> user to create minimal
            <code class="filename">NetworkManager.conf</code> file:
          </p>
          <pre class="root">
<kbd class=
"command">cat &gt;&gt; /etc/NetworkManager/NetworkManager.conf &lt;&lt; "EOF"
<code class="literal">[main]
plugins=keyfile</code>
EOF</kbd>
</pre>
          <p>
            This file should not be modified directly by users of the system.
            Instead, system specific changes should be made using
            configuration files in the <code class=
            "filename">/etc/NetworkManager/conf.d</code> direcotry.
          </p>
          <p>
            To allow polkit to manage authorizations, add the following
            configuration file:
          </p>
          <pre class="root">
<kbd class=
"command">cat &gt; /etc/NetworkManager/conf.d/polkit.conf &lt;&lt; "EOF"
<code class="literal">[main]
auth-polkit=true</code>
EOF</kbd>
</pre>
          <p>
            To use something other than the built-in dhcp client (recommended
            if using only <span class=
            "command"><strong>nmcli</strong></span>), use the following
            configuration (valid values are dhclient, dhcpcd, and internal):
          </p>
          <pre class="userinput">
<kbd class=
"command">cat &gt; /etc/NetworkManager/conf.d/dhcp.conf &lt;&lt; "EOF"
<code class="literal">[main]
dhcp=</code><em class="replaceable"><code>dhclient</code></em>
EOF</kbd>
</pre>
          <p>
            To prevent <span class="application">NetworkManager</span> from
            updating the <code class="filename">/etc/resolv.conf</code> file,
            add the following configuration file:
          </p>
          <pre class="userinput">
<kbd class=
"command">cat &gt; /etc/NetworkManager/conf.d/no-dns-update.conf &lt;&lt; "EOF"
<code class="literal">[main]
dns=none</code>
EOF</kbd>
</pre>
          <p>
            For additional configuation options, see <span class=
            "command"><strong>man 5 NetworkManager.conf</strong></span>.
          </p>
          <p>
            To allow regular users permission to configure network
            connections, you should add them to the <code class=
            "systemitem">netdev</code> group, and create a <span class=
            "application">polkit</span> rule that grants access. Run the
            following commands as the <code class="systemitem">root</code>
            user:
          </p>
          <pre class="root">
<kbd class="command">groupadd -fg 86 netdev &amp;&amp;
/usr/sbin/usermod -a -G netdev <em class=
"replaceable"><code>&lt;username&gt;</code></em>

cat &gt; /usr/share/polkit-1/rules.d/org.freedesktop.NetworkManager.rules &lt;&lt; "EOF"
<code class="literal">polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 &amp;&amp; subject.isInGroup("netdev")) {
        return polkit.Result.YES;
    }
});</code>
EOF</kbd>
</pre>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <h3 class="sect3">
            <a id="NetworkManager-init" name="NetworkManager-init"></a>
          </h3>
          <h4 class="title">
            <a id="NetworkManager-init" name=
            "NetworkManager-init"></a><span class="phrase">Boot Script</span>
          </h4>
          <p>
            To automatically start the <span class=
            "command"><strong>NetworkManager</strong></span> daemon when the
            system is rebooted, install the <code class=
            "filename">/etc/rc.d/init.d/networkmanager</code>bootscript from
            the <a class="xref" href="../introduction/bootscripts.html"
            title="BLFS Boot Scripts">blfs-bootscripts-20191204</a> package.
          </p>
          <div class="admon note">
            <img alt="[Note]" src="../images/note.png" />
            <h3>
              Note
            </h3>
            <p>
              If using <span class="application">Network Manager</span> to
              manage an interface, any previous configuration for that
              interface should be removed, and the interface brought down
              prior to starting <span class="application">Network
              Manager</span>.
            </p>
          </div>
          <pre class="root">
<kbd class="command">make install-networkmanager</kbd>
</pre>
        </div>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">NetworkManager, nmcli, nm-online, nmtui,
              and, symlinked to nmtui: nmtui-connect, nmtui-edit, and
              nmtui-hostname</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">libnm.so and several modules under
              /usr/lib/NetworkManager</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/etc/NetworkManager,
              /usr/include/NetworkManager, /usr/lib/NetworkManager,
              /usr/share/doc/NetworkManager-1.22.10,
              /usr/share/gtk-doc/html/{libnm,NetworkManager} (if the
              documentation is built), and /var/lib/NetworkManager</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="nmcli" name="nmcli"></a><span class=
                    "term"><span class=
                    "command"><strong>nmcli</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a command-line tool for controlling <span class=
                    "application">NetworkManager</span> and getting its
                    status.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="nm-online" name="nm-online"></a><span class=
                    "term"><span class=
                    "command"><strong>nm-online</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an utility to find out whether you are online.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="nmtui" name="nmtui"></a><span class=
                    "term"><span class=
                    "command"><strong>nmtui</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an interactive ncurses based interface for
                    <span class="application">nmcli</span>.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="nmtui-connect" name=
                    "nmtui-connect"></a><span class="term"><span class=
                    "command"><strong>nmtui-connect</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an interactive ncurses based interface connection to
                    activate/deactivate connections.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="nmtui-edit" name="nmtui-edit"></a><span class=
                    "term"><span class=
                    "command"><strong>nmtui-edit</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an interactive ncurses based interface connection
                    editor.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="nmtui-hostname" name=
                    "nmtui-hostname"></a><span class="term"><span class=
                    "command"><strong>nmtui-hostname</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is an interactive ncurses based interface hostname
                    editor.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="NetworkManager-prog" name=
                    "NetworkManager-prog"></a><span class="term"><span class=
                    "command"><strong>NetworkManager</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the network management daemon.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libnm" name="libnm"></a><span class=
                    "term"><code class="filename">libnm.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    contains functions used by <span class=
                    "application">NetworkManager</span>.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-23 16:46:15 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="bind-utils.html" title=
          "BIND Utilities-9.16.1">Prev</a>
          <p>
            BIND Utilities-9.16.1
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="nmap.html" title="Nmap-7.80">Next</a>
          <p>
            Nmap-7.80
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="netutils.html" title=
          "Chapter&nbsp;16.&nbsp;Networking Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
